/**
 * Created by lenovo on 2017/4/28.
 */
(function(){
    //页面的高度
    parent.$('#content').css('height','1000px').css('width','960px');

    $('.repair span').on('click',function(){
        parent.$('iframe').attr('src','./html/clubRepair.html');
    })

    /*获取内容区域的高度*/
    var height = $('.club').height();
    parent.$('#content').css('height',height + 90 +'px');

    //俱乐部信息接口
    
	var clubId=config.sessionStroageGet("clubId");
    clubId=1
    $.ajax({
        url:config.baseUrl+'/settings/getClubInfo?clubId='+clubId,
        type:'get',
        dataType:'json',
        success:function(result){
			$(".cl_introduce .div1").text(result.body.introduction||"");
			$(".cl_name .span2").text(result.body.clubName||"");
			$(".cl_logo img").attr("src",result.body.logo||"")
			$(".cl_cover img").attr("src",result.body.background||"")
			$(".cl_description .p1").text(result.body.info||"")
//$(".cl_description").text()
//cl_cover
        },
        error:function(result){

        }
    })
    
    //俱乐部标签接口
    $.ajax({
        url:config.baseUrl+'/settings/getClubLabelList',
        type:'GET',
        data:{'clubId':clubId},
        dataType:'json',
        success:function(result){
           if(result){
               var html="";
               for(var i = 0;i<result.body.length;i++){
               	   html+='<span class="span2">'+result.body[i].name+'</span>'
               }
               $(html).appendTo('.cl_tag'); 
            }
        },
        error:function(result){
             console.log("标签生成失败");
        }
    });
    
    
    
})()